import http from '../index'

// 分页获取面单模板
export const getLabelTemplates = ({ ascended = null, current = null, size = null, sortFieldName = null, status = null, labelDesignContent = null, labelDesignName = null, labelDesignType = null }) => {
    return http.get("label-templates", { ascended, current, size, sortFieldName, status, labelDesignContent, labelDesignName, labelDesignType })
}

// 根据sid获取面单模板
export const getLabelTemplateDetail = ({ sid }) => {
    return http.get("label-templates/" + sid)
}

// 根据sid获取面单模板内容
export const getLabelTemplateContent = ({ sid }) => {
    return http.get("label-templates/" + sid + '/content')
}

// 新增面单模板
export const addLabelTemplate = ({ content, labelDesignName, labelDesignType, note = null, status = null }) => {
    return http.post("label-templates", { content, labelDesignName, labelDesignType, note, status })
}

// 修改面单模板
export const editLabelTemplate = ({ sid, content, labelDesignName, labelDesignType, note = null, status = null }) => {
    return http.put("label-templates/" + sid, { content, labelDesignName, labelDesignType, note, status })
}

// 批量删除面单模板
export const delLabelTemplates = ({ sidList }) => {
    return http.put("label-templates/delete", { sidList })
}

// 根据sid启用-停用面单模板
export const changeLabelTemplateStatus = ({ sid }) => {
    return http.put("label-templates/" + sid + '/status')
}

// 增加面单模板打印次数
export const addLabelTemplateCount = ({ sid }) => {
    return http.put("label-templates/" + sid + '/add-count')
}